package cn.tedu.reflection;

/*
Author     :Dsi
Date       : 2021/11/23 10:29
Description: 该类用于测试反射的物料类
*/
public class Student {
    public String name;
    int age;
    public Student(){
        System.out.println("无参构造");
    }
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Student(String name) {
        this.name = name;
    }

    public void play(){
        System.out.println("玩玩~");
    }
    public void eat(int n){
        System.out.println("今天是吃的第"+n+"天~~");
    }
    //5.如果不想查看学生对象的地址值，在目标类里面重写toString方法

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}